import React from 'react';
import PropTypes from 'prop-types'
import classnames from 'classnames';
import './myButton.scss';
const MyButton = (props) => {
    const buttonClass = classnames({
        'my-button':true,
        [`my-button-${props.type}`]:true,
        [`my-button-${props.size}`]:true,
        [`my-button-${props.type}-danger`]:props.danger,
    })
    return (
        <button className={buttonClass}>
            {props.icon} {props.children}
        </button>
    );
};
MyButton.propTypes = {
    type: PropTypes.oneOf(['primary', 'default', 'dashed', 'text', 'link']),
    size: PropTypes.oneOf(['small', 'middle', 'large',]),
    danger: PropTypes.bool,
    children: PropTypes.node,
    icon: PropTypes.element,
}

export default MyButton;